<ui:composition template="/dynamic/layout/layout.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core">

	<ui:define name="content">
		<style>
#srmails th {
	background-color: #3b7c33;
	background-image: -webkit-linear-gradient(top, #5fae53, #3b7c33);
	color: white;
}

#srmails td {
	text-align: left;
}

#srmails th {
	text-align: left;
}

#srmails
						tr.mail_row {
	background: white;
	border: 1px solid #E0E9F1;
}

#srmails .col1 {
	width: 10%;
}

#srmails .mail_row {
	font-size: 120%;
}

#srmails .link_row {
	font-size: 100%;
}

table#srmails {
	border-collapse: collapse;
	margin-left: 5px;
}

.optsWrapper {
	position: relative;
	height: 20px;
}

.optsWrapper a {
	position: absolute;
	top: 2px;
	padding: 0;
	margin: 0
}

.hidden {
	display: none;
}

.inboxdiv a {
	display: block;
	text-decoration: none;
	color: #333333;
}

.inboxdiv span {
	display: block;
}

.senddate {
	font-size: 10px;
}

.mailcontent {
	font-size: 10px;
}

#srmails tr:hover {
	background-color: #F3F7FB;
}
</style>
		<h3>Odebrane</h3>
		<table id="srmails" width="100%">
			<tr>
				<th>Nadawca/Data</th>
				<th>Temat/Treść</th>
				<th>Kosz</th>
			</tr>
			<h:form id="inboxForm">
				<c:forEach items="#{mailMBean.allMails}" var="c">
					<tr class="mail_row" id="row_#{c.sender}" style="#{c.readed==true? '': 'font-weight: bold;'}">
						<td id="mail_sender_#{c.sender}">
							<div class="inboxdiv">
								<p:commandLink action="#{mailMBean.showMail}" ajax="false">
									<f:param value="#{c.id}" name="mailId" />
									<span class="sender">#{c.sender.username} </span>
									<span class="senddate">#{c.getFullDate()}</span>
								</p:commandLink>
							</div>
						</td>
						<td id="mail_content_#{c.sender}">
							<div class="inboxdiv">
								<p:commandLink action="#{mailMBean.showMail}" ajax="false">
									<f:param value="#{c.id}" name="mailId" />
									<span class="mailtitle">#{c.title}</span>
									<span class="mailcontent">#{c.cutString(c.content)} </span>
								</p:commandLink>
							</div>
						</td>
						<td id="mail_trash_#{c.sender}">
							<div class="inboxdiv">
								<p:commandLink action="#{mailMBean.deleteMailFromInbox}"
									ajax="false">
									<f:param value="#{c.id}" name="mailId" />
									<img src="${facesContext.externalContext.requestContextPath}/static/images/kosz.PNG" alt="Kosz" />
								</p:commandLink>
							</div>
						</td>
					</tr>
				</c:forEach>
			</h:form>
		</table>
	</ui:define>
</ui:composition>